/**
 * 
 */
package trungsi.gea.photos.stripes;

import java.util.Collection;
import java.util.Date;
import java.util.Locale;

import net.sourceforge.stripes.validation.TypeConverter;
import net.sourceforge.stripes.validation.ValidationError;

/**
 * @author trungsi
 *
 */
public class DateTypeConverter implements TypeConverter<Date> {

	/* (non-Javadoc)
	 * @see net.sourceforge.stripes.validation.TypeConverter#convert(java.lang.String, java.lang.Class, java.util.Collection)
	 */
	@Override
	public Date convert(String longString, Class<? extends Date> clazz,
			Collection<ValidationError> errors) {
		System.out.println("longString="+longString);
		return new Date(Long.parseLong(longString));
	}

	/* (non-Javadoc)
	 * @see net.sourceforge.stripes.validation.TypeConverter#setLocale(java.util.Locale)
	 */
	@Override
	public void setLocale(Locale arg0) {
		// TODO Auto-generated method stub

	}

}
